#include "friendmode.h"
#include "ui_friendmode.h"
#include "pagecontroller.h"
#include <QDebug>
#include "userchatmode.h"
#include <memory>
#include "userinfo.h"

FriendMode::FriendMode(QWidget *parent,const QString &username,const QString &uid) :
    QPushButton(parent),
    ui(new Ui::FriendMode)
{
    ui->setupUi(this);
    this->username =username;
    this->uid=uid;
    connect(this,&QPushButton::clicked,[=](){
//        std::shared_ptr<userChatmode>
        PageController::Getinstance()->showChatPage(nullptr,username,uid);
    });

    ui->lb_userinfo2->setText(username);
    ui->lb_usersign2->setText(uid);


}

FriendMode::~FriendMode()
{
    delete ui;
}

void FriendMode::setUsername(const QString &username)
{
    ui->lb_userinfo2->setText(username);
}

void FriendMode::setUid(const QString &uid)
{
    ui->lb_usersign2->setText(uid);
}








void FriendMode::on_toolButton_clicked()
{
    qDebug()<<2;
    emit sendRemove();
}

